package com.swanclouds.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @author 张立强
 * @version jdk1.8.0
 */
public abstract class Device extends Resource {

    @JsonProperty("Id")
    private String id;

    /**
     * 系统资源的ID
     * @return Id
     */
    public String getId() {
        return this.id;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "Device {" +
                "id='" + id + '\'' +
                '}';
    }
}
